<#include "/layout/_layout.ftl" /><@head title="首页|四眼井|互联网人的乐园 ">
<link href="${static_domain}/js/jquery-validation/validate.min.css" type="text/css" rel="stylesheet"/>
</@head><@body>
<div style="width:600px;margin:20px auto">
	<div class="ui-box">
		<div class="ui-box-title">
			<h3>新用户注册</h3>
		</div>
		<div class="ui-box-container ui-box-content">
			<form action="/register/verify" method="post" class="ui-form" id="register_form">
				<div class="ui-form-item">
					<label for="" class="ui-label">
						<span class="ui-form-required">
							*
						</span>用户名
					</label>
					<input class="ui-input" type="text" name="users.username">

					<p class="ui-form-explain">
						英文字母a~z,A~Z,以及数字0～9
					</p>
				</div>
				<div class="ui-form-item">
					<label for="" class="ui-label">
						<span class="ui-form-required">
							*
						</span>密码
					</label>
					<input class="ui-input {required:true,minlength:6}"
					       type="password" name="users.password"
					       id="password">
				</div>
				<div class="ui-form-item">
					<label for="" class="ui-label">
						<span class="ui-form-required">
							*
						</span>重复密码
					</label>
					<input class="ui-input {required:true,minlength:6,equalTo:'#password'}"
					       type="password" name="repassword">
				</div>
				<div class="ui-form-item">
					<label for="" class="ui-label">
						<span class="ui-form-required">
							*
						</span>邮箱
					</label>
					<input class="ui-input" type="text" name="users.email">
				</div>
				<div class="ui-form-item">
					<input type="checkbox" name="check">
					<label for="check">
						我已阅读并接受本站服务协议
					</label>
				</div>
				<div class="ui-form-item">
					<input type="submit" class="btn-g blue" value="注册">
					<input type="button" class="btn-g white" value="取消">
				</div>
			</form>
		</div>
	</div>
</div>
</@body>
<@script>
<script src="${static_domain}/js/jquery-validation/validate.min.js"></script>
<script src="${static_domain}/js/jquery-validation/jquery.metadata.min.js"></script>
<script type="text/javascript">
	$(function (validate) {
		$("#register_form").validate({
			onkeyup: false,
			rules: {
				'users.username': {
					required: true,
					minlength: 5,
					remote: "/register/check"
				},
				'users.email': {
					required: true,
					email: true,
					remote: '/register/check'
				},
				'check': 'required'
			},
			messages: {
				'users.username': {
					remote: '该用户名已被占用'
				},
				'users.email': {
					remote: '该邮箱已被占用'
				},
				'check': ""
			},
			submitHandler: function (form) {
				form.submit();
			}
		});
	});
</script>
</@script>